import QtQuick 2.0
import QtQuick.Layouts 1.14
import QtMultimedia 5.14

Item {
    id:root
    property string messageBoxTitle: ''

    signal scaleFunc();
    signal rotateFunc();
    signal originFunc();
    signal mirrorFunc();

    //设置音频
    MediaPlayer {
        id: playMusic
        playbackRate: 2
        source: "qrc:/music/click2.mp3"
    }

    Rectangle{
        radius: 4
        anchors.fill: parent
        //Layout.topMargin: 32
        //Layout.bottomMargin: 15
        Layout.alignment:Qt.AlignHCenter | Qt.AlignCenter

        ColumnLayout{
            anchors.fill: parent
            anchors.bottomMargin: 5
            Text {
                id: sizetTitle
                text: root.messageBoxTitle
                font.pixelSize: 24
                font.bold: true
                Layout.alignment:  Qt.AlignCenter
            }

            Rectangle{
                 Layout.fillWidth : true
                 height: 1
                 color: '#C6C6C6'
            }

            Rectangle{
                 Layout.fillWidth : true
                 Layout.fillHeight : true
                 RowLayout{
                     anchors.fill: parent
                     spacing: 0

                     Rectangle{
                         id:rect
                         width: 77
                         height: 77
                         border.color: "#C6C6C6"
                         border.width: 1
                         //color: selectInx == 3 ? root.recSelectColor :'transparent'
                         Layout.alignment:Qt.AlignHCenter | Qt.AlignCenter

                         Image {
                             source: "qrc:/imgs/1.png"
                             anchors.centerIn: parent
                         }

                         MouseArea {
                              anchors.fill: parent
                              onPressed: {
                                  //playMusic.play();
                                  root.scaleFunc()
                                  parent.scale*=.95
                              }
                              onReleased: {
                                  parent.scale/=.95
                              }
                          }
                     }

                     /*Rectangle{
                         width: 77
                         height: 77
                         border.color: "#C6C6C6"
                         border.width: 1
                         //color: selectInx == 4 ? root.recSelectColor :'transparent'
                         Layout.alignment:Qt.AlignHCenter | Qt.AlignCenter

                         Image {
                             source: "qrc:/imgs/2.png"
                             anchors.centerIn: parent
                         }

                         MouseArea {
                              anchors.fill: parent
                              onPressed: {
                                  //playMusic.play();
                                  root.rotateFunc()
                                  parent.scale*=.95
                              }
                              onReleased: {
                                  parent.scale/=.95
                              }
                          }
                     }*/

                     Rectangle{
                         width: 77
                         height: 77
                         border.color: "#C6C6C6"
                         border.width: 1
                         //color: selectInx == 5 ? root.recSelectColor :'transparent'
                         Layout.alignment:Qt.AlignHCenter | Qt.AlignCenter

                         Image {
                             source: "qrc:/imgs/3.png"
                             anchors.centerIn: parent
                         }

                         MouseArea {
                              anchors.fill: parent
                              onPressed: {
                                  //playMusic.play();
                                  root.originFunc()
                                  parent.scale*=.95
                              }
                              onReleased: {
                                  parent.scale/=.95
                              }
                          }
                     }

                     /*Rectangle{
                         width: 77
                         height: 77
                         border.color: "#C6C6C6"
                         border.width: 1
                         //color: selectInx == 6 ? root.recSelectColor :'transparent'
                         Layout.alignment:Qt.AlignHCenter | Qt.AlignCenter

                         Image {
                             source: "qrc:/imgs/4.png"
                             anchors.centerIn: parent
                         }

                         MouseArea {
                              anchors.fill: parent
                              onPressed: {
                                  //playMusic.play();
                                  root.mirrorFunc()
                                  parent.scale*=.95
                              }
                              onReleased: {
                                  parent.scale/=.95
                              }
                          }
                     }*/
                 }
            }
        }
    }
}
